package com.lzc.springcloud.msconsumeruser.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.lzc.springcloud.msconsumeruser.entity.User;

//@FeignClient(name = "ms-eureka-provider-user-client") // 有集成eureka时，根据name值去eureka获取
//@FeignClient(name = "${feign.client.user.name}", url = "${feign.client.user.url}") // 没有集成eureka时，可以定义url进行调用
@FeignClient(name = "${feign.client.user.name}")
public interface UserFeignClient {

	@GetMapping("/getUser/{id}")
	// @RequestMapping(value="/getUser/{id}", method=RequestMethod.GET)
	public User getUser(@PathVariable("id") Integer id);

	@PostMapping("/getUserInfo")
	public User getUserInfo(@RequestBody User user);

	@GetMapping("/getUserInfo2")
	public User getUserInfo2(@RequestParam("id") Long id, @RequestParam("name") String name);
}
